package com.example.wanandroid.service.impl;

import com.example.wanandroid.mapper.LoginTokenMapper;
import com.example.wanandroid.pojo.LoginToken;
import com.example.wanandroid.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Desc TODO
 * @Date 2020/4/16 21:58
 */
@Service
public class TokenServiceImpl implements TokenService {
    @Autowired
    LoginTokenMapper loginTokenMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return loginTokenMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(LoginToken record) {
        return loginTokenMapper.insertSelective(record);
    }

    @Override
    public LoginToken selectByPrimaryKey(Long id) {
        return loginTokenMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKey(LoginToken record) {
        return loginTokenMapper.updateByPrimaryKey(record);
    }

    @Override
    public LoginToken selectByToken(String token) {
        return loginTokenMapper.selectByToken(token);
    }

    @Override
    public int deleteByToken(String token) {
        return loginTokenMapper.deleteByToken(token);
    }
}
